package org.joinme.backend.mapper;

import org.apache.ibatis.annotations.Param;
import org.joinme.backend.model.WechatUser;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Repository
@Transactional
public interface WechatUserMapper {
    int deleteByPrimaryKey(Integer userId);

    int insert(WechatUser record);

    int insertSelective(WechatUser record);

    WechatUser selectByPrimaryKey(Integer userId);

    WechatUser selectByOpenId(String openId);

    List<WechatUser> listUser(@Param("start") int start, @Param("limit") int limit);

    int updateByPrimaryKeySelective(WechatUser record);

    int updateByPrimaryKey(WechatUser record);

    int updateCredit(@Param("userId") int userId, @Param("credit") double credit);

    List<WechatUser> selectParticipantsByCarPoolingId(int carPoolingId);

    List<WechatUser> selectApplicantsByCarPoolingId(int carPoolingId);
}
